package com.thrd.taiexhibition.adapter;

import android.content.Context;
import android.text.TextUtils;
import android.widget.TextView;

import com.thrd.basicframework.bean.BaseRecyclerAdapter;
import com.thrd.taiexhibition.R;
import com.thrd.taiexhibition.bean.BeanHomeSort;
import com.thrd.taiexhibition.fresco.FrescoImage;
import com.thrd.taiexhibition.fresco.FrescoUtils;

import java.util.List;

/**
 * @author: ${唐杰}
 * @date: 2021/3/30
 */
public class PupopHomeAdapter extends BaseRecyclerAdapter<BeanHomeSort> {
    public PupopHomeAdapter(Context context, List<BeanHomeSort> data) {
        super(context, data);
    }

    @Override
    public void bindData(BaseViewHolder holder, BeanHomeSort beanHomeSort) {
        FrescoImage mFrescoImage = (FrescoImage) holder.getView(R.id.fi_image);
        TextView mText = (TextView) holder.getView(R.id.tv_text);
        mText.setText(TextUtils.isEmpty(beanHomeSort.getMenuName())?"":beanHomeSort.getMenuName());
        FrescoUtils.getInstance().setPrefixProgressLoad(getContext(),mFrescoImage,beanHomeSort.getCoverImg());
    }

    @Override
    public int getItemLayoutId() {
        return R.layout.item_pupop_home;
    }
}
